Skip to content

feat(isthmus): add method converting SQL to POJO Plan#473

Merged
vbarua merged 1 commit intosubstrait-io:mainfrom
nielspardon:par-sqltosubstrait
Aug 11, 2025
Merged

feat(isthmus): add method converting SQL to POJO Plan#473
vbarua merged 1 commit intosubstrait-io:mainfrom
nielspardon:par-sqltosubstrait

Conversation

@nielspardon
Copy link
Member

@nielspardon nielspardon commented Aug 11, 2025

I noticed that #432 could benefit from this refactoring.

BREAKING CHANGE: deprecates SqlToSubstrait.execute()

  • adds a new convert() method to SqlToSubstrait which converts a SQL statements string to a POJO Plan instead of a proto Plan
  • deprecates the execute() method in SqlToSubstrait which converts a SQL statements string to a proto Plan
  • changes any uses of execute() in the code to convert()
  • removes the @VisibleForTesting annotation from SqlToSubstrait.createSqlToRelConverter() and SqlToSubstrait.getBestExpRelRoot() since they are not actually used in testing and makes them protected instead of package private
  • adds @VisibleForTesting annotation to SqlToSubstrait.sqlToRelNode() which is actually still used in testing
  • changes the TpcdsQueryTest and TpchQueryTest to test POJO to SQL and PROTO to SQL separately since I noticed that TPC-DS query 67 only fails for PROTO to SQL but started working to POJO to SQL

@nielspardon nielspardon requested a review from vbarua August 11, 2025 19:37
@nielspardon nielspardon self-assigned this Aug 11, 2025
BREAKING CHANGE: deprecates SqlToSubstrait.execute()

Signed-off-by: Niels Pardon <par@zurich.ibm.com>
Copy link
Member

@vbarua vbarua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good to me. This in inpsired me to push through my own changes extending these. I'll open a PR for those shortly.

Also, I don't believe this a breaking change as you've only deprecated the method, not removed it.

@vbarua vbarua merged commit 418742f into substrait-io:main Aug 11, 2025
12 checks passed
@vbarua
Copy link
Member

vbarua commented Aug 11, 2025

Taking this even further in #474

@nielspardon nielspardon deleted the par-sqltosubstrait branch October 3, 2025 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants